package monitor

import "vrcm/src/vrcm/common/models"

type MonitorEvent struct {
	models.Model

	TenantId      string         `json:"tenant_id" gorm:"type:varchar(50);comment:租户"`
	EventName     string         `json:"event_name" gorm:"type:varchar(50);comment:活动"`
	SetId         int            `json:"set_id" gorm:"type:bigint;comment:片场id"`
	Password      string         `json:"password" gorm:"type:varchar(50);comment:密码"`
	AuditPassword string         `json:"audit_password" gorm:"type:varchar(50);comment:审片密码"`
	StartTime     int64          `json:"start_time" gorm:"type:int;comment:开始时间"`
	EndTime       int64          `json:"end_time" gorm:"type:int;comment:结束时间"`
	TaskState     int            `json:"task_state" gorm:"type:tinyint;comment:任务状态 1启用 2停用"` //
	MonitorState  int            `json:"monitor_state" gorm:"type:tinyint;comment:监看状态 1 启用 2停用"`
	ChannelId     int            `json:"channel_id" gorm:"type:bigint;comment:频道id"` //
	Active        int            `json:"active" gorm:"type:int;comment:正在播出的节目单索引"`  //
	MonitorModels []MonitorModel `json:"monitor_models" gorm:"-"`
	MonitorUrl    string         `json:"monitor_url" gorm:"-"`
	GroupId       int            `json:"group_id" gorm:"type:bigint;comment:分组id"`                //
	SourcePackId  int            `json:"source_pack_id" gorm:"type:bigint;comment:资源包id"`         //
	SkipParamIds  string         `json:"skip_param_ids" gorm:"type:varchar(500);comment:跳过节目单id"` //
	VersionId     int            `json:"version_id" gorm:"type:int;comment:版本号"`                  //
	models.ModelTime
	models.ControlBy
}

func (MonitorEvent) TableName() string {
	return "monitor_event"
}

type ProgramRound struct {
	models.Model

	EventId      int    `json:"event_id" gorm:"type:bigint;comment:活动id"`
	ChannelId    int    `json:"channel_id" gorm:"type:bigint;comment:频道id"`
	TenantId     string `json:"tenant_id" gorm:"type:varchar(50);comment:租户"`
	ProgramId    string `json:"program_id" gorm:"type:varchar(50);comment:节目单id"`
	ProgramName  string `json:"program_name" gorm:"type:varchar(300);comment:节目单名称"`
	Describe     string `json:"describe" gorm:"type:varchar(300);comment:节目单描述"`
	StartTime    string `json:"start_time" gorm:"type:varchar(50);comment:节目单开始时间"`
	EndTime      string `json:"end_time" gorm:"type:varchar(50);comment:节目单结束时间"`
	LookUp       string `json:"look_up" gorm:"type:varchar(50);comment:是否支持"`
	IsSkip       int    `json:"is_skip" gorm:"type:tinyint;comment:1跳过 2不跳过"`
	ProgramRound int    `json:"program_round" gorm:"type:int;comment:场记"`
	DelaySecond  int    `json:"delay_second" gorm:"type:tinyint"`
	DelayType    int    `json:"delay_type" gorm:"type:tinyint;comment: 1 延迟 2 提前"`
	models.ModelTime
	models.ControlBy
}

func (ProgramRound) TableName() string {
	return "program_round"
}

type EventPlayAddress struct {
	models.Model

	TenantId      string `json:"tenant_id" gorm:"type:varchar(50);comment:租户"`
	EventId       int    `json:"event_id" gorm:"type:bigint;comment:活动id"`
	MonitorId     int    `json:"monitor_id" gorm:"type:bigint;comment:监看id"`
	PlayAddressId int    `json:"play_address_id" gorm:"type:bigint;comment:播放地址id"`
	models.ModelTime
	models.ControlBy
}

func (EventPlayAddress) TableName() string {
	return "event_play_address"
}

type ProgramRoundModel struct {
	EventId      int    `json:"event_id" gorm:"type:bigint;comment:活动id"`
	StartTime    string `json:"start_time" gorm:"type:varchar(50);comment:节目单开始时间"`
	EndTime      string `json:"end_time" gorm:"type:varchar(50);comment:节目单结束时间"`
	ProgramRound int    `json:"program_round" gorm:"type:int;comment:场记"`
}

type ProgramOrigin struct {
	models.Model

	EventId     int    `json:"event_id" gorm:"type:bigint;comment:活动id"`
	ChannelId   int    `json:"channel_id" gorm:"type:bigint;comment:频道id"`
	TenantId    string `json:"tenant_id" gorm:"type:varchar(50);comment:租户"`
	ProgramId   string `json:"program_id" gorm:"type:varchar(50);comment:节目单id"`
	ProgramName string `json:"program_name" gorm:"type:varchar(300);comment:节目单名称"`
	Describe    string `json:"describe" gorm:"type:varchar(300);comment:节目单描述"`
	StartTime   string `json:"start_time" gorm:"type:varchar(50);comment:节目单开始时间"`
	EndTime     string `json:"end_time" gorm:"type:varchar(50);comment:节目单结束时间"`
	LookUp      string `json:"look_up" gorm:"type:varchar(50);comment:是否支持"`
	IsSkip      int    `json:"is_skip" gorm:"type:tinyint;comment:1跳过 2不跳过"`
	IsPlaying   int    `json:"is_playing" gorm:"type:tinyint;comment: 是否正在播出 1是 2否"`
	DelaySecond int    `json:"delay_second" gorm:"type:tinyint"`
	DelayType   int    `json:"delay_type" gorm:"type:tinyint;comment: 1 延迟 2 提前"`
	models.ModelTime
	models.ControlBy
}

func (ProgramOrigin) TableName() string {
	return "program_origin"
}

type EventMember struct {
	models.Model

	TenantId       string `json:"tenant_id" gorm:"type:varchar(50);comment:租户"`
	EventId        int    `json:"event_id" gorm:"type:bigint;comment:活动id"`
	MemberId       int    `json:"member_id" gorm:"type:bigint;comment:监看id"`
	InvitationCode string `json:"invitation_code" gorm:"type:varchar(50);;comment:播放地址id"`
	models.ModelTime
	models.ControlBy
}

func (EventMember) TableName() string {
	return "event_member"
}

type EventMemberModel struct {
	models.Model

	TenantId       string `json:"tenant_id" gorm:"type:varchar(50);comment:租户"`
	EventId        int    `json:"event_id" gorm:"type:bigint;comment:活动id"`
	MemberId       int    `json:"member_id" gorm:"type:bigint;comment:监看id"`
	InvitationCode int    `json:"invitation_code" gorm:"type:bigint;comment:播放地址id"`
	MemberName     string `json:"member_name"  gorm:"column:member_name;type:varchar(100);comment:关联id"`
	MemberAccount  string `json:"member_account" gorm:"column:member_account;varchar(100);comment:类型 1系统 2自定义"`
	WorkSite       string `json:"worksite"  gorm:"column:worksite;type:varchar(100);comment:关联id"`

	models.ModelTime
	models.ControlBy
}

type MemberInfo struct {
	WorksiteMember WorksiteMember `json:"worksite_member"`
	Worksite       Worksite       `json:"worksite"`
	MonitorModels  []MonitorModel `json:"monitor_models"`
	MonitorEvent   MonitorEvent   `json:"monitor_event"`
}
